package com.liu.com.liu.dynamicproxy;

import com.liu.staticProxyDemo_1_0_version.A_Factory;
import com.liu.staticProxyDemo_1_0_version.ManToolsFactory;
import com.liu.staticProxyDemo_1_1_version.B_Factory;
import com.liu.staticProxyDemo_1_1_version.WomanToolsFactory;

public class Main {
    public static void main(String[] args) {
        ManToolsFactory aFactory =new A_Factory();
        WomanToolsFactory bFactory= new B_Factory();
        DynamicProxy_Demo1 zhangsan = new DynamicProxy_Demo1();
        zhangsan.setFactory(aFactory);
        ManToolsFactory client1=(ManToolsFactory)zhangsan.getProxyInstance();
        client1.saleManTools("D");
        zhangsan.setFactory(bFactory);
        WomanToolsFactory client2 = (WomanToolsFactory) zhangsan.getProxyInstance();
        client2.saleWomanToos(180);


    }
}
